home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Dots & Pixels / sources / noisedots.cp < prev    next >
Text File  |  1995-09-29  |  646b  |  34 lines

  1. #include <QuickDraw.h>
  2.  
  3. #include "C_randomizer.h"
  4. #include "screenarea.h"
  5. #include "screendots.h"
  6. #include "phaser.h"
  7. #include "noisedots.h"
  8.  
  9. void noisedots::compute_addresses()
  10. {
  11.     if( cycle_length == 1)    // special-cased for efficiency
  12.     {
  13.         for( int i = 0; i < numdots; i++)
  14.         {
  15.             const int x = any_x();
  16.             const int y = any_y();
  17.             dot_addresses[ i] = &screen[ y][ x];
  18.         }
  19.     } else {
  20.         (void)major_step();
  21.         for( int i = 0; i < numdots; i++)
  22.         {
  23.             if( minor_step() == 0)
  24.             {
  25.                 const int x = any_x();
  26.                 const int y = any_y();
  27.                 dot_addresses[ i] = &screen[ y][ x];
  28.             } else {
  29.                 dot_addresses[ i] = old_dot_addresses[ i];
  30.             }
  31.         }
  32.     }
  33. }
  34.